package com.qf.micro_search;

import com.qf.service.ISearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * SpringBoot启动过程中触发
 */
@Component
public class ApplicationRunning implements CommandLineRunner {

    @Autowired
    private ISearchService searchService;

    @Override
    public void run(String... args) throws Exception {
        searchService.createIndex();
    }
}
